package com.gne.data.platform;

import com.gne.data.platform.mysocket.NettyServer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;
import java.net.InetSocketAddress;

@SpringBootApplication
@MapperScan(basePackages = "com.gne.data.platform.dao")
public class TestApplication {

	@Autowired
	NettyServer nettyServer;
    public static void main(String[] args) {
        SpringApplication.run(TestApplication.class, args);

        //启动服务端
        NettyServer nettyServer = new NettyServer();
        nettyServer.start(new InetSocketAddress("0.0.0.0", 1421));
    }

//	@PostConstruct
	public void startNetty() {
//		nettyServer.start(new InetSocketAddress("0.0.0.0", 1421));
		//FIXME 在有些机子上面报错，直接无法访问mvc了，怎么回事
	}

}
